
getmid()
function getmid() {


    let mid = localStorage.getItem('mid')
    if (mid) {
        gettouxiang(mid)
    }


    if (mid) {
        $('.login').css('display', 'none')
        $('.user').css('display', 'inline-block')
    } else {
        $('.login').css('display', 'inline-block')
        $('.user').css('display', 'none')
    }

    
}
$('.out').click(function () {
    localStorage.removeItem('mid')
    localStorage.removeItem('token')
    localStorage.removeItem('touxiang')
    getmid()
})

async function gettouxiang(mid) {
    let res = await myAjax({
        url: '/api/user',
        data: {
            mid
        },

    })
    console.log();
    $('.user img').attr('src',res.result.result.head_photo_url)
}


